package mysql

import (
	"gorm.io/plugin/soft_delete"
)

type Base struct {
	ID        uint                  `json:"id" gorm:"primaryKey"`
	CreatedBy uint                  `json:"created_by"`
	UpdatedBy uint                  `json:"updated_by"`
	CreatedAt int64                 `json:"created_at"`
	UpdatedAt int64                 `json:"updated_at"`
	DeletedAt soft_delete.DeletedAt `json:"deleted_at"`
}

func (b *Base) SetCreatedBy(accountId uint) {
	b.CreatedBy = accountId
}

func (b *Base) SetCreatedAt(v int64) {
	b.CreatedAt = v
}

func (b *Base) SetUpdatedBy(accountId uint) {
	b.UpdatedBy = accountId
}

func (b *Base) SetUpdatedAt(v int64) {
	b.UpdatedAt = v
}
